home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2002 #11
/
Amiga Plus CD - 2002 - No. 11.iso
/
Tools
/
Development
/
PowerD
/
powerd
/
source
/
lib
/
powerd_lib.lha
/
PowerD_PPC
/
RealStr.d
< prev
next >
Wrap
Text File
|
2000-11-20
|
390b
|
21 lines
OPT PPC,NOEXE
PROC RealStr(str:PTR TO CHAR,f:DOUBLE,n=1)(PTR TO CHAR)
DEFD d
DEFL top,rest,neg=FALSE
DEF buf[24]:CHAR // this is large enough
IF f<0 THEN neg:=TRUE
d:=FAbs(f)
top:=d
d-=top
IF d<0
top--
d++
ENDIF
d*=1000000000
rest:=d
IF f<0 THEN top:=-top
StringF(buf,'\s\d.\z\r\d[9]',IF neg THEN '-' ELSE NIL,Abs(top),rest)
StrCopy(str,buf,StrLen(buf)-9+n)
ENDPROC str